﻿using System;

namespace TEST0415
{
    //有一个热水器，包含一个加热器，一个报警器和一个显示屏，
    //当水温超过95时： 
    //1.报警器会考试发出语音，告诉你水温度
    //2.液晶屏也会改变水温消失，来提示已经烧开了
    delegate void MyDel();

    class heat
    {
        public void heating()
        {
            Console.WriteLine("热水器正在加热");
        }

        public void alarming()
        {
            Console.WriteLine("水温超过95");
        }

        public void showing()
        {
            Console.WriteLine("已经烧开了");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            heat h1 = new heat();
            Console.WriteLine("热水器是否加热");
            string h = Console.ReadLine();
            if (h == "Y" || h == "y")
            {
                h1.heating();
                for (int i = 1; i <= 100; i++)
                {
                    Console.WriteLine(i);
                    if (i > 95 && i < 100)
                    {
                        h1.alarming();
                        h1.showing();
                        Console.WriteLine("热水器是否继续加热");
                        string H = Console.ReadLine();
                        if (H == "Y" || H == "y")
                        {
                            continue;
                        }
                        else
                        {
                            break;
                        }
                    }else if (i == 100)
                    {
                        Console.WriteLine("热水器是否继续加热");
                        string H = Console.ReadLine();
                        if (H == "Y" || H == "y")
                        {
                            Console.WriteLine("傻逼，再烧就炸了");
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                
               
            }
            
           

        }
    }
}
